﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="list.aspx.cs" Inherits="HungryCrowd.category.list" MasterPageFile="~/master/Main.Master" EnableEventValidation="false" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="width:650px;text-align:left;padding-left:100px;">
    <asp:Repeater ID="rptCategories" runat="server" ClientIDMode="Static" OnItemDataBound="rptCategories_ItemDataBound">
        <HeaderTemplate>
            <div style="height:30px;font-size:larger">Hungry Crowd: Traders</div>
        </HeaderTemplate>
        <ItemTemplate>
            <div style="float:left;width:650px;">
                <div style="float:left;width:180px;height:180px;"><asp:HyperLink ID="lnkViewTraders" runat="server" ClientIDMode="Static"><asp:Image ID="Image1" src='<%# DataBinder.Eval(Container.DataItem, "ImageUrl") %>' runat="server" width="150" height="130"/></asp:HyperLink></div>
                <div style="float:left;width:420px;height:130px;"><%# DataBinder.Eval(Container.DataItem, "Synopsis") %> <div style="float:left;width:100px;padding-top:50px;"><asp:HyperLink ID="lnkURL" runat="server" ClientIDMode="Static"></asp:HyperLink></div></div>
                
            </div>
        </ItemTemplate>
        <FooterTemplate>
            <div></div>
        </FooterTemplate>
    </asp:Repeater>
    </div>
    <script type="text/javascript">
        //$('#btnViewTraders').click(function () {
        //    debugger;
        //    var catId = 1; //= $('.link')[0].href.substr($('.link')[0].href.lastIndexOf('/') + 1, $('.link')[0].href.length - $('.link')[0].href.lastIndexOf('/'));
        //    var dataToSend = { CategoryId: catId, MethodName: 'GetTradersByCategory' };
            
        //    var options = {
        //        data: dataToSend,
        //        dataType: 'JSON',
        //        type: 'POST',
        //        url: '/server/ajax.aspx',
        //        success: function (response, status, XHR) { 
        //            debugger;
        //            //if (status != 'success') {
        //            //    debugger;
        //            //    alert('Error occurred.' + XHR);
        //            //}
        //            //else {
        //            //    debugger;
        //                window.location.href = '';
        //            //}
        //        }
        //    };
        //    $.ajax(options);
        //});
    </script>
</asp:Content>